<%= javascript_include_tag 'prototype' %>
<%= javascript_include_tag 'photoEffect' %>

<style TYPE="text/css">
<!--
<% height = 40+220*@entries.length
if height < 480 #縦幅が小さすぎ
  height = 480
end
 %>
#left_mainContents{
	height: <%= height-10 %>px;
}

#center_mainContents{
	height: <%= height %>px;
}

#right_mainContents{
	height: <%= height %>px;
}
-->
</style>

<%= image_tag ("/images/list_title.gif", :align => "center", :valign => "middle") %>

<% @entries.each_with_index do |entry, idx| %>
<% p entry %>
<% even = (idx % 2).zero? %>
<% if even %>
<div id="entry1">
<% else %>
<div id="entry2">
<% end %>

<% if even %>
  <div id="photo_area">
	<%= link_to(image_tag(PICTURES_DIR + entry.picture_url, :size => '96x128', :align => "center", :valign => "bottom", :id => "mypic#{idx}"), image_path(PICTURES_DIR + entry.picture_url)) %>
  </div>
<% else %>
  <div id="botton_area">
	<%= link_to(image_tag("/images/view_off_btn.gif", {:alt => "みる"}), :action => 'show', :id => entry) %>
  </div>
<% end %>

  <div id="text_area">
	<div id="subject"><b><%=h entry.subject %></b></div>
	<div id="place">場所：<%=h entry.spot.name %></div>
	<div id="time">時：<%=h entry.entry_at.strftime("%Y年%m月%d日%H時%M分") %></div>
	<div id="weather">天気：<%=h entry.weather %></div>
	<div id="memo">句：<%=h entry.body %></div>
  </div>

<% if even %>
  <div id="botton_area">
	<%= link_to(image_tag("/images/view_off_btn.gif", {:alt => "みる"}), :action => 'show', :id => entry) %>
  </div>
<% else %>
  <div id="photo_area">
	<%= link_to(image_tag(PICTURES_DIR + entry.picture_url, :size => '96x128', :align => "center", :valign => "bottom", :id => "mypic#{idx}"), image_path(PICTURES_DIR + entry.picture_url)) %>
  </div>

<% end %>

</div>
<div class="clear">&nbsp;</div>

<script type="text/javascript">
  new PhotoEffect().execute('mypic<%= idx %>', <%= '-' if even %>0.08, '<%=image_path("photoframe.png")%>');
</script>

<% end %>
